import type { NestExpressApplication } from '@nestjs/platform-express'
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
/**
 * @description: 设置swagger
 * @param {NestExpressApplication} app 应用程序
 */
export const SetupSwagger = (app: NestExpressApplication) => {
  const swaggerConfig = new DocumentBuilder()
    .setTitle('后台管理系统')
    .setDescription('后台管理系统接口文档')
    .addBearerAuth()
    .build()
  const document = SwaggerModule.createDocument(app, swaggerConfig)
  SwaggerModule.setup('api/swagger', app, document)
}
